<title> Détail location </title>
	
<section>
	<div id="titre">
					
			<?php
				while ($titre = mysqli_fetch_array($resultat) ) {
				
					$debut_baille = date("d-m-Y", strtotime($titre['debut_baille']));
					$fin_baille = date("d-m-Y", strtotime($titre['fin_baille']));
					
					echo "<p>".$titre['type']." - ".$titre['surface']." m² - ".$titre['ville']." disponible du ".$debut_baille." au ".$fin_baille."</p>"; 
				}
			?>
			
	</div>
</section>	
	
	
<section>
		<div id="photo">
		Photo
	</div>
</section>	
	

<section>	
	<div id="detail">
		
			<?php
				while ($detail = mysqli_fetch_array($resultat2)){
					echo "<p>".$detail['description']."</p>";
				}
			?>
		
	</div>
</section>


<div style="clear:both; border:none;">
</div>


<section>	
	<div id="description">
		
		<ul>
			<?php
				while ($description = mysqli_fetch_array($resultat3)){
				
					$debut_baille = date("d-m-Y", strtotime($description['debut_baille']));
					$debut_location = date("Y-m-d", strtotime($description['debut_baille']));
					
					$fin_location = date("Y-m-d", strtotime($description['fin_baille']));
					$fin_baille = date("d-m-Y", strtotime($description['fin_baille']));
					
					
					echo "<li> Localisation : ".$description['pays'].", ".$description['ville']."</li>
					<li> Adresse : ".$description['adresse'].", ".$description['code_postal']."</li>
					<li> Logement : ".$description['type']." de ".$description['surface']." m², ".$description['piece']." pièces </li>
					<li> Disponibilité : ".$debut_baille." jusqu'à ".$fin_baille."</li>
					<li> Tarif : par journée  ".$description['tarif_journee'].", par semaine ".$description['tarif_semaine']."</li>
					<li> Proposé à la location par : ".$description['login']."</li>";
				}
			?>
		</ul>
		
	</div>
</section>

<section>
	<div id="proposition">
	
		<form name="formproposition" id="formproposition" method="POST" action="confirmation.php">
			<label name="debut">Début de la location : </label> <input type="date" name="debut" id="debut" <?php echo "min='".$debut_location."' max='".$fin_location."'";?>/></br>
			<label name="fin">Fin de la location : </label> <input type="date" name="fin" id="fin" <?php echo "min='".$debut_location."' max='".$fin_location."'";?>/></br>
			<input type="hidden" name="id_prix" id="id_prix" <?php echo 'value="'.$id.'"'; ?>/></br>
			<input type='submit' name='confirmer'/> 
			<?php if($_SESSION['correcte'] == true){
				echo "Vos dates de location ne sont pas correctes, merci de faire une demande correcte";
				  }
			?>
			
		</form>
		
	</div>	
</section>


<section>	
	<div id="deja_reserve">
		
		<?php
		
			while ($reserve = mysqli_fetch_array($resultat4)){
			
			$debut_reservation = date("d-m-Y", strtotime($reserve['debut_location']));
			$fin_reservation = date("d-m-Y", strtotime($reserve['fin_location']));
			
				echo "<p>Déjà reservé du ".$debut_reservation." au ".$fin_reservation."</p>";
			}
		?>
	</div>
</section>

<section>	
	<div id="avis">
		Avis
	</div>
</section>